.class public Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;
.super Ljava/lang/Object;
.source "SimpleFileDialog.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$SimpleFileDialogListener;
    }
.end annotation


# instance fields
.field private FileOpen:I

.field private FileSave:I

.field private FolderChoose:I

.field private Select_type:I

.field private Selected_File_Name:Ljava/lang/String;

.field public defaultFileName:Ljava/lang/String;

.field private input_text:Landroid/widget/EditText;

.field private m_SimpleFileDialogListener:Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$SimpleFileDialogListener;

.field private m_context:Landroid/content/Context;

.field private m_dir:Ljava/lang/String;

.field private m_listAdapter:Landroid/widget/ArrayAdapter;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/widget/ArrayAdapter<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private m_sdcardDirectory:Ljava/lang/String;

.field private m_subdirs:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private m_titleView:Landroid/widget/TextView;


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$SimpleFileDialogListener;)V
    .locals 2

    .line 55
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 30
    iput v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FileOpen:I

    const/4 v0, 0x1

    .line 31
    iput v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FileSave:I

    const/4 v0, 0x2

    .line 32
    iput v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FolderChoose:I

    .line 33
    iget v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FileSave:I

    iput v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->Select_type:I

    const-string v0, ""

    .line 34
    iput-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_sdcardDirectory:Ljava/lang/String;

    const-string v1, "default.txt"

    .line 38
    iput-object v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->defaultFileName:Ljava/lang/String;

    .line 39
    iget-object v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->defaultFileName:Ljava/lang/String;

    iput-object v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->Selected_File_Name:Ljava/lang/String;

    .line 42
    iput-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_dir:Ljava/lang/String;

    const/4 v0, 0x0

    .line 43
    iput-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_subdirs:Ljava/util/List;

    .line 44
    iput-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_SimpleFileDialogListener:Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$SimpleFileDialogListener;

    .line 45
    iput-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_listAdapter:Landroid/widget/ArrayAdapter;

    const-string v0, "FileOpen"

    .line 56
    invoke-virtual {p2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 57
    iget p2, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FileOpen:I

    iput p2, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->Select_type:I

    goto :goto_0

    :cond_0
    const-string v0, "FileSave"

    .line 58
    invoke-virtual {p2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 59
    iget p2, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FileSave:I

    iput p2, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->Select_type:I

    goto :goto_0

    :cond_1
    const-string v0, "FolderChoose"

    .line 60
    invoke-virtual {p2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p2

    if-eqz p2, :cond_2

    .line 61
    iget p2, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FolderChoose:I

    iput p2, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->Select_type:I

    goto :goto_0

    .line 63
    :cond_2
    iget p2, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FileOpen:I

    iput p2, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->Select_type:I

    .line 65
    :goto_0
    iput-object p1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_context:Landroid/content/Context;

    .line 66
    invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;

    move-result-object p1

    invoke-virtual {p1}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_sdcardDirectory:Ljava/lang/String;

    .line 67
    iput-object p3, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_SimpleFileDialogListener:Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$SimpleFileDialogListener;

    .line 71
    :try_start_0
    new-instance p1, Ljava/io/File;

    iget-object p2, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_sdcardDirectory:Ljava/lang/String;

    invoke-direct {p1, p2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {p1}, Ljava/io/File;->getCanonicalPath()Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_sdcardDirectory:Ljava/lang/String;
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    return-void
.end method

.method static synthetic access$000(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;)Ljava/lang/String;
    .locals 0

    .line 29
    iget-object p0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_dir:Ljava/lang/String;

    return-object p0
.end method

.method static synthetic access$002(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;Ljava/lang/String;)Ljava/lang/String;
    .locals 0

    .line 29
    iput-object p1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_dir:Ljava/lang/String;

    return-object p1
.end method

.method static synthetic access$100(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;)Ljava/lang/String;
    .locals 0

    .line 29
    iget-object p0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->Selected_File_Name:Ljava/lang/String;

    return-object p0
.end method

.method static synthetic access$102(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;Ljava/lang/String;)Ljava/lang/String;
    .locals 0

    .line 29
    iput-object p1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->Selected_File_Name:Ljava/lang/String;

    return-object p1
.end method

.method static synthetic access$200(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;)V
    .locals 0

    .line 29
    invoke-direct {p0}, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->updateDirectory()V

    return-void
.end method

.method static synthetic access$300(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;)Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$SimpleFileDialogListener;
    .locals 0

    .line 29
    iget-object p0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_SimpleFileDialogListener:Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$SimpleFileDialogListener;

    return-object p0
.end method

.method static synthetic access$400(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;)I
    .locals 0

    .line 29
    iget p0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->Select_type:I

    return p0
.end method

.method static synthetic access$500(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;)I
    .locals 0

    .line 29
    iget p0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FileOpen:I

    return p0
.end method

.method static synthetic access$600(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;)I
    .locals 0

    .line 29
    iget p0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FileSave:I

    return p0
.end method

.method static synthetic access$700(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;)Landroid/widget/EditText;
    .locals 0

    .line 29
    iget-object p0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->input_text:Landroid/widget/EditText;

    return-object p0
.end method

.method static synthetic access$800(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;)Landroid/content/Context;
    .locals 0

    .line 29
    iget-object p0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_context:Landroid/content/Context;

    return-object p0
.end method

.method static synthetic access$900(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;Ljava/lang/String;)Z
    .locals 0

    .line 29
    invoke-direct {p0, p1}, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->createSubDir(Ljava/lang/String;)Z

    move-result p0

    return p0
.end method

.method private createDirectoryChooserDialog(Ljava/lang/String;Ljava/util/List;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;
    .locals 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/util/List<",
            "Ljava/lang/String;",
            ">;",
            "Landroid/content/DialogInterface$OnClickListener;",
            ")",
            "Landroid/app/AlertDialog$Builder;"
        }
    .end annotation

    .line 220
    new-instance v0, Landroid/app/AlertDialog$Builder;

    iget-object v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_context:Landroid/content/Context;

    invoke-direct {v0, v1}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    .line 221
    iget-object v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_context:Landroid/content/Context;

    const v2, 0x7f1100ee

    invoke-virtual {v1, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    .line 222
    iget-object v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_context:Landroid/content/Context;

    const-string v2, "layout_inflater"

    .line 223
    invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/view/LayoutInflater;

    const v2, 0x7f0c0058

    const/4 v3, 0x0

    .line 224
    invoke-virtual {v1, v2, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    .line 225
    invoke-virtual {v0, v1}, Landroid/app/AlertDialog$Builder;->setView(Landroid/view/View;)Landroid/app/AlertDialog$Builder;

    .line 251
    iget v2, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->Select_type:I

    iget v3, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FolderChoose:I

    if-eq v2, v3, :cond_0

    iget v3, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FileSave:I

    if-ne v2, v3, :cond_1

    :cond_0
    const v2, 0x7f0900c2

    .line 257
    invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/Button;

    .line 260
    new-instance v3, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$3;

    invoke-direct {v3, p0}, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$3;-><init>(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;)V

    invoke-virtual {v2, v3}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 295
    :cond_1
    new-instance v2, Landroid/widget/LinearLayout;

    iget-object v3, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_context:Landroid/content/Context;

    invoke-direct {v2, v3}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    const/4 v3, 0x1

    .line 296
    invoke-virtual {v2, v3}, Landroid/widget/LinearLayout;->setOrientation(I)V

    const v2, 0x7f0901b5

    .line 299
    invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    iput-object v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_titleView:Landroid/widget/TextView;

    .line 304
    iget-object v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_titleView:Landroid/widget/TextView;

    invoke-virtual {v1, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 308
    iget p1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->Select_type:I

    iget v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FileOpen:I

    if-eq p1, v1, :cond_2

    iget v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FileSave:I

    if-ne p1, v1, :cond_3

    .line 310
    :cond_2
    new-instance p1, Landroid/widget/EditText;

    iget-object v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_context:Landroid/content/Context;

    invoke-direct {p1, v1}, Landroid/widget/EditText;-><init>(Landroid/content/Context;)V

    iput-object p1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->input_text:Landroid/widget/EditText;

    .line 311
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->input_text:Landroid/widget/EditText;

    iget-object v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->defaultFileName:Ljava/lang/String;

    invoke-virtual {p1, v1}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    .line 320
    :cond_3
    invoke-direct {p0, p2}, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->createListAdapter(Ljava/util/List;)Landroid/widget/ArrayAdapter;

    move-result-object p1

    iput-object p1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_listAdapter:Landroid/widget/ArrayAdapter;

    .line 321
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_listAdapter:Landroid/widget/ArrayAdapter;

    const/4 p2, -0x1

    invoke-virtual {v0, p1, p2, p3}, Landroid/app/AlertDialog$Builder;->setSingleChoiceItems(Landroid/widget/ListAdapter;ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    .line 322
    invoke-virtual {v0, v3}, Landroid/app/AlertDialog$Builder;->setCancelable(Z)Landroid/app/AlertDialog$Builder;

    return-object v0
.end method

.method private createListAdapter(Ljava/util/List;)Landroid/widget/ArrayAdapter;
    .locals 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Ljava/lang/String;",
            ">;)",
            "Landroid/widget/ArrayAdapter<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .line 341
    new-instance v6, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$4;

    iget-object v2, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_context:Landroid/content/Context;

    const v3, 0x7f0c0070

    const v4, 0x7f09024d

    move-object v0, v6

    move-object v1, p0

    move-object v5, p1

    invoke-direct/range {v0 .. v5}, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$4;-><init>(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;Landroid/content/Context;IILjava/util/List;)V

    return-object v6
.end method

.method private createSubDir(Ljava/lang/String;)Z
    .locals 1

    .line 166
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 167
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result p1

    if-nez p1, :cond_0

    .line 168
    invoke-virtual {v0}, Ljava/io/File;->mkdir()Z

    move-result p1

    return p1

    :cond_0
    const/4 p1, 0x0

    return p1
.end method

.method private getDirectories(Ljava/lang/String;)Ljava/util/List;
    .locals 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/List<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .line 175
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 178
    :try_start_0
    new-instance v1, Ljava/io/File;

    invoke-direct {v1, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 181
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_dir:Ljava/lang/String;

    iget-object v2, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_sdcardDirectory:Ljava/lang/String;

    invoke-virtual {p1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-nez p1, :cond_0

    const-string p1, ".."

    .line 182
    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 184
    :cond_0
    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result p1

    if-eqz p1, :cond_5

    invoke-virtual {v1}, Ljava/io/File;->isDirectory()Z

    move-result p1

    if-nez p1, :cond_1

    goto :goto_2

    .line 189
    :cond_1
    invoke-virtual {v1}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object p1

    array-length v1, p1

    const/4 v2, 0x0

    :goto_0
    if-ge v2, v1, :cond_6

    aget-object v3, p1, v2

    .line 191
    invoke-virtual {v3}, Ljava/io/File;->isDirectory()Z

    move-result v4

    if-eqz v4, :cond_2

    .line 194
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v3}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v4, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v3, "/"

    invoke-virtual {v4, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-interface {v0, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_1

    .line 195
    :cond_2
    iget v4, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->Select_type:I

    iget v5, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FileSave:I

    if-eq v4, v5, :cond_3

    iget v4, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->Select_type:I

    iget v5, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FileOpen:I

    if-ne v4, v5, :cond_4

    .line 198
    :cond_3
    invoke-virtual {v3}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v3

    invoke-interface {v0, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :cond_4
    :goto_1
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    :cond_5
    :goto_2
    return-object v0

    .line 205
    :catch_0
    :cond_6
    new-instance p1, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$2;

    invoke-direct {p1, p0}, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$2;-><init>(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;)V

    invoke-static {v0, p1}, Ljava/util/Collections;->sort(Ljava/util/List;Ljava/util/Comparator;)V

    return-object v0
.end method

.method private updateDirectory()V
    .locals 2

    .line 328
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_subdirs:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->clear()V

    .line 329
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_subdirs:Ljava/util/List;

    iget-object v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_dir:Ljava/lang/String;

    invoke-direct {p0, v1}, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->getDirectories(Ljava/lang/String;)Ljava/util/List;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z

    .line 330
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_titleView:Landroid/widget/TextView;

    iget-object v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_dir:Ljava/lang/String;

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 331
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_listAdapter:Landroid/widget/ArrayAdapter;

    invoke-virtual {v0}, Landroid/widget/ArrayAdapter;->notifyDataSetChanged()V

    .line 333
    iget v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->Select_type:I

    iget v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FileSave:I

    if-eq v0, v1, :cond_0

    iget v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->FileOpen:I

    if-ne v0, v1, :cond_1

    .line 335
    :cond_0
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->input_text:Landroid/widget/EditText;

    iget-object v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->Selected_File_Name:Ljava/lang/String;

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    :cond_1
    return-void
.end method


# virtual methods
.method public chooseChooser(Ljava/lang/String;)V
    .locals 3

    .line 88
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 89
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-virtual {v0}, Ljava/io/File;->isDirectory()Z

    move-result v0

    if-nez v0, :cond_1

    .line 91
    :cond_0
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_sdcardDirectory:Ljava/lang/String;

    .line 96
    :cond_1
    :try_start_0
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/io/File;->getCanonicalPath()Ljava/lang/String;

    move-result-object p1
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 102
    iput-object p1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_dir:Ljava/lang/String;

    .line 103
    invoke-direct {p0, p1}, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->getDirectories(Ljava/lang/String;)Ljava/util/List;

    move-result-object v0

    iput-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_subdirs:Ljava/util/List;

    .line 133
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_subdirs:Ljava/util/List;

    new-instance v1, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$1SimpleFileDialogOnClickListener;

    invoke-direct {v1, p0}, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$1SimpleFileDialogOnClickListener;-><init>(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;)V

    invoke-direct {p0, p1, v0, v1}, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->createDirectoryChooserDialog(Ljava/lang/String;Ljava/util/List;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object p1

    .line 135
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_context:Landroid/content/Context;

    const v1, 0x7f1101af

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    new-instance v1, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$1;

    invoke-direct {v1, p0}, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog$1;-><init>(Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;)V

    invoke-virtual {p1, v0, v1}, Landroid/app/AlertDialog$Builder;->setPositiveButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    iget-object v1, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_context:Landroid/content/Context;

    const v2, 0x7f11004f

    .line 156
    invoke-virtual {v1, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/app/AlertDialog$Builder;->setNegativeButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    .line 158
    invoke-virtual {p1}, Landroid/app/AlertDialog$Builder;->create()Landroid/app/AlertDialog;

    move-result-object p1

    .line 161
    invoke-virtual {p1}, Landroid/app/AlertDialog;->show()V

    :catch_0
    return-void
.end method

.method public openChooser()V
    .locals 2

    .line 80
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_dir:Ljava/lang/String;

    const-string v1, ""

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 81
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_sdcardDirectory:Ljava/lang/String;

    invoke-virtual {p0, v0}, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->chooseChooser(Ljava/lang/String;)V

    goto :goto_0

    .line 83
    :cond_0
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->m_dir:Ljava/lang/String;

    invoke-virtual {p0, v0}, Llt/noframe/gpsfarmguide/utils/SimpleFileDialog;->chooseChooser(Ljava/lang/String;)V

    :goto_0
    return-void
.end method
